function showRangeOR(event){	
	var percentage = document.getElementsByName('openraise')[0].value;
	event = event || window.event;
	if(event.keyCode == 112){
		document.getElementById("img1").src = 'img/'+percentage+'.png';
		document.getElementById("image").style.display = "block";
	}
}

function showRange3B(event){	
	var percentage = document.getElementsByName('3bet')[0].value;
	event = event || window.event;
	if(event.keyCode == 112){
		document.getElementById("img1").src = 'img/'+percentage+'.png';
		document.getElementById("image").style.display = "block";
	}
}

function showRangeOR2(event){	
	var percentage = document.getElementsByName('openraise2')[0].value;
	event = event || window.event;
	if(event.keyCode == 112){
		document.getElementById("img2").src = 'img/'+percentage+'.png';
		document.getElementById("image2").style.display = "block";
	}
}

function showRange3B2(event){	
	var percentage = document.getElementsByName('3bet2')[0].value;
	event = event || window.event;
	if(event.keyCode == 112){
		document.getElementById("img2").src = 'img/'+percentage+'.png';
		document.getElementById("image2").style.display = "block";
	}
}

function delImg(){
	document.getElementById("image").style.display = "none";
}

function delImg2(){
	document.getElementById("image2").style.display = "none";
}

function reshove(){
	var openraise = document.getElementsByName('openraise')[0].value;
	var threebet = document.getElementsByName('3bet')[0].value;
	var stacksize = document.getElementsByName('stacksize')[0].value;
	
	var xmlhttp;
	
	try{
		// Opera 8.0+, Firefox, Safari, Chrome
		xmlhttp = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Error
				alert("Error");
				return false;
			}
		}
	}
	
	xmlhttp.onreadystatechange = function(){
		if(xmlhttp.readyState == 4 && xmlhttp.status == 200){
			var res = xmlhttp.responseText;
			var arr = res.split('|');
			
			document.getElementById("res1").innerHTML = "";
			document.getElementById("res2").innerHTML = "";
			document.getElementById("res3").innerHTML = "";
			document.getElementById("res4").innerHTML = "";
			
			document.getElementById("label1").innerHTML = "Reshove: ";
			document.getElementById("label2").innerHTML = "Call Reshove: ";
			document.getElementById("label3").innerHTML = "4-Bet Shove: ";
			document.getElementById("label4").innerHTML = "";
			
			document.getElementById("res1").innerHTML = arr[0];
			document.getElementById("res2").innerHTML = arr[1];
			document.getElementById("res3").innerHTML = arr[2];
		}
	}
	
	xmlhttp.open("POST","global.inc.php?fn=reshove&param="+openraise+'|'
														+threebet+'|'
														+stacksize,true);
	xmlhttp.send();	
}

function shovecall(){
	var openraise = document.getElementsByName('openraise')[0].value;
	var threebet = document.getElementsByName('3bet')[0].value;
	var stacksize = document.getElementsByName('stacksize')[0].value;

	
	var xmlhttp;
	
	try{
		// Opera 8.0+, Firefox, Safari, Chrome
		xmlhttp = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Error
				alert("Error");
				return false;
			}
		}
	}
	
	xmlhttp.onreadystatechange = function(){
		if(xmlhttp.readyState == 4 && xmlhttp.status == 200){
			var res = xmlhttp.responseText;
			var arr = res.split('|');

			document.getElementById("res1").innerHTML = "";
			document.getElementById("res2").innerHTML = "";
			document.getElementById("res3").innerHTML = "";
			document.getElementById("res4").innerHTML = "";
			
			document.getElementById("label1").innerHTML = "Shove Nash: ";
			document.getElementById("label2").innerHTML = "Chubukov:";
			document.getElementById("label3").innerHTML = "Call Open: ";
			document.getElementById("label4").innerHTML = "Call Nash: ";
			
			document.getElementById("res1").innerHTML = arr[0];
			document.getElementById("res2").innerHTML = arr[1];
			document.getElementById("res3").innerHTML = arr[2];
			document.getElementById("res4").innerHTML = arr[3];
		}
	}
	
	xmlhttp.open("POST","global.inc.php?fn=shovecall&param="+openraise+'|'						
														+stacksize,true);
	xmlhttp.send();	
}

function reshove2(){
	var openraise = document.getElementsByName('openraise2')[0].value;
	var threebet = document.getElementsByName('3bet2')[0].value;
	var stacksize = document.getElementsByName('stacksize2')[0].value;
	
	var xmlhttp;
	
	try{
		// Opera 8.0+, Firefox, Safari, Chrome
		xmlhttp = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Error
				alert("Error");
				return false;
			}
		}
	}
	
	xmlhttp.onreadystatechange = function(){
		if(xmlhttp.readyState == 4 && xmlhttp.status == 200){
			var res = xmlhttp.responseText;
			var arr = res.split('|');
			
			document.getElementById("res1_2").innerHTML = "";
			document.getElementById("res2_2").innerHTML = "";
			document.getElementById("res3_2").innerHTML = "";
			document.getElementById("res4_2").innerHTML = "";
			
			document.getElementById("label1_2").innerHTML = "Reshove: ";
			document.getElementById("label2_2").innerHTML = "Call Reshove: ";
			document.getElementById("label3_2").innerHTML = "4-Bet Shove: ";
			document.getElementById("label4_2").innerHTML = "";
			
			document.getElementById("res1_2").innerHTML = arr[0];
			document.getElementById("res2_2").innerHTML = arr[1];
			document.getElementById("res3_2").innerHTML = arr[2];
		}
	}
	
	xmlhttp.open("POST","global.inc.php?fn=reshove&param="+openraise+'|'
														+threebet+'|'
														+stacksize,true);
	xmlhttp.send();	
}

function shovecall2(){
	var openraise = document.getElementsByName('openraise2')[0].value;
	var threebet = document.getElementsByName('3bet2')[0].value;
	var stacksize = document.getElementsByName('stacksize2')[0].value;

	
	var xmlhttp;
	
	try{
		// Opera 8.0+, Firefox, Safari, Chrome
		xmlhttp = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Error
				alert("Error");
				return false;
			}
		}
	}
	
	xmlhttp.onreadystatechange = function(){
		if(xmlhttp.readyState == 4 && xmlhttp.status == 200){
			var res = xmlhttp.responseText;
			var arr = res.split('|');

			document.getElementById("res1_2").innerHTML = "";
			document.getElementById("res2_2").innerHTML = "";
			document.getElementById("res3_2").innerHTML = "";
			document.getElementById("res4_2").innerHTML = "";
			
			document.getElementById("label1_2").innerHTML = "Shove Nash: ";
			document.getElementById("label2_2").innerHTML = "Chubukov:";
			document.getElementById("label3_2").innerHTML = "Call Open: ";
			document.getElementById("label4_2").innerHTML = "Call Nash: ";
			
			document.getElementById("res1_2").innerHTML = arr[0];
			document.getElementById("res2_2").innerHTML = arr[1];
			document.getElementById("res3_2").innerHTML = arr[2];
			document.getElementById("res4_2").innerHTML = arr[3];
		}
	}
	
	xmlhttp.open("POST","global.inc.php?fn=shovecall&param="+openraise+'|'						
														+stacksize,true);
	xmlhttp.send();	
}